Skip to content

Add core Python/Matplotlib version contract checks#613

Open
cvanelteren wants to merge 7 commits intomainfrom
ci/check-core-version-contract
Open

Add core Python/Matplotlib version contract checks#613
cvanelteren wants to merge 7 commits intomainfrom
ci/check-core-version-contract

Conversation

@cvanelteren
Copy link
Collaborator

Introduce a shared tools/ci/version_support.py helper that derives the supported Python versions, supported Matplotlib versions, and the core CI test matrix directly from pyproject.toml. This removes the duplicated inline parser from the main workflow and gives the project a single source of truth for the version contract that matters most to UltraPlot.

Add ultraplot/tests/test_core_versions.py to assert that Python classifiers stay aligned with requires-python, that the matrix workflow uses the shared helper, that the test-map workflow stays pinned to the oldest supported Python/Matplotlib pair, and that the publish workflow builds with a supported Python version. Also expand the PR change filter so workflow, tool, and version-policy changes still trigger the relevant checks.

Introduce a shared tools/ci/version_support.py helper that derives the supported Python versions, supported Matplotlib versions, and the core CI test matrix directly from pyproject.toml. This removes the duplicated inline parser from the main workflow and gives the project a single source of truth for the version contract that matters most to UltraPlot.

Add ultraplot/tests/test_core_versions.py to assert that Python classifiers stay aligned with requires-python, that the matrix workflow uses the shared helper, that the test-map workflow stays pinned to the oldest supported Python/Matplotlib pair, and that the publish workflow builds with a supported Python version. Also expand the PR change filter so workflow, tool, and version-policy changes still trigger the relevant checks.
Add concise docstrings to the shared version-support helper and the new version-contract tests so it is immediately clear which piece derives the supported ranges, which piece shapes the CI matrix, and what each test is protecting against.

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

This comment was marked as off-topic.

Stop inferring supported Python and Matplotlib minors from half-open ranges alone, because that breaks across major-version upgrades. Define the supported core versions explicitly in pyproject, validate them against the declared bounds, reuse the shared helper from noxfile, and add regression coverage for a future 3.x to 4.x Matplotlib transition.
@cvanelteren cvanelteren requested a review from beckermr March 12, 2026 00:46
Use direct range filtering for candidate core versions so version checks work cleanly across major-version boundaries. Keep same-major arithmetic expansion only as a fallback, and add a regression test covering a 3.x to 4.x Matplotlib transition.
@cvanelteren
Copy link
Collaborator Author

The goal is to extend this to warn us if python or matplotlib can be updated

Teach Dependabot to monitor the project Python dependencies in pyproject.toml so Matplotlib and related package bumps are proposed automatically alongside the existing GitHub Actions updates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants